<?
include_once("database.php");
include_once("../backend.php");
include_once("../login_management.php");
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- TemplateBeginEditable name="doctitle" -->
<title>place | Team Spyder Scouting</title>
<!-- TemplateEndEditable -->

<link rel="stylesheet" type="text/css" href="../scouting/scouting.css"/>
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
</head>

<body>
<div class="main">
<div class="top2"><l>
<a class="navigation" href="./index.php">Home</a> | 
<a class="navigation" href="./register.php">Register a user</a> | 
<a class="navigation" href="./activeevent.php">Set Active Event</a> | 
<a class="navigation" href="./edit.php">Manage Users</a> | 
<a class="navigation" href="./teams.php">Input Teams</a> | 
<a class="navigation" href="cleanup.php"> Clean up DB</a> | 
<a class="navigation" href="./eventsetup/index.php"> Event Setup </a> | 
<a class="navigation" href="../scoutingspyder/index.php"> Main </a> | 
<script type="text/javascript">
function LoadLogin()
{
var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("content").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","login.php",true);
xmlhttp.send();
}
</script>

<?
if($logged_in)
{
	echo "<l> Welcome,&nbsp;" . $_SESSION['username'] . " </l>";
	echo "<a class=\"navigation\" href=\"./logout.php\">Log&nbsp;out</a>\n";
}
else
{
	echo "<l> You&nbsp;are&nbsp;not&nbsp;logged&nbsp;in. </l>";
	echo "<a class=\"navigation\" href=\"#\" onclick=\"LoadLogin()\">Log in</a>\n";
}

?>
</l>
</div>
<div class="content"><!-- TemplateBeginEditable name="Content"  -->
<!-- TemplateEndEditable -->
</div>
</div>

</body>
</html>
